﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UAgentMacNewNGAdd.aspx.cs" Inherits="IHISCETeim.Web.AgentSys.SvrMgr.UAgentMacNewNGAdd" %>
<style>
    
    .XZJobTrainDetailtable{border:solid #000; border-width:1px;border-collapse: collapse; }
    .XZJobTrainDetailtable th{border:solid #000; border-width:1px; line-height:20px; padding:2PX; font-weight:bold;}
    .XZJobTrainDetailtable td 
    {
        border-bottom: 1px solid #000;
        border-right: 1px solid #000;
        line-height: 21px;
        overflow: hidden;
        padding: 0 3px;   
    }
</style>
<div class="pageContent" style="border:1px #B8D0D6 solid;" >
    <form method="post" action="SvrMgr/UAgentMacNewNGAdd.aspx?ajaxmethod=<%=Action %>&UASID=<%=UASID %>&Action=<%=Action %>" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone)">
    <div class="pageFormContent" layoutH="66">        
        <table  style="width:100%">
              <tr>
                <td  style=" line-height:25px;">入库时间：</td>
                <td   style=" line-height:25px;">
                    <input type="text" name="IntoStockDate" class="date required" value="<%=UAgentMacStockObj.IntoStockDate.Replace(" 0:00:00","") %>"  />
                </td>                
                <td  style=" line-height:25px;">经销商</td>
                <td  style=" line-height:25px;">
                    <input type="text" name="dwz.orgLookup.AgentName" class="required textInput autocomplete"  alt="" value="<%=UAgentMacStockObj.AgentName %>" readonly />
                    <%if(HasPower(IHISCETeim.Web.Permission.经销商平台_公司人员)){ %>
                    <a class="btnLook" href="/MachineSys/SAPAgentListLookUp.aspx" lookupgroup="orgLookup"
                        maxable="false" width="600" resizable="false" title="经销商列表">
                        <hi:text key="查找带回" />
                    </a>
                    <%} %>
                </td>
                 <td  style=" line-height:25px;"></td>
                <td  style=" line-height:25px;">
                    
                </td>
            </tr>
            <tr>
                <td  style=" line-height:25px;">型号：</td>
                <td   style=" line-height:25px;">
                    <%=GetMacType("select","MacType",UAgentMacStockObj.MacType ) %>
                </td>                
                <td  style=" line-height:25px;">机号：</td>
                <td  style=" line-height:25px;">
                    <input type="text"  name="SerialNumber" class="required"  value="<%=UAgentMacStockObj.SerialNumber %>"/>
                </td>
                 <td  style=" line-height:25px;">计时器时间：</td>
                <td  style=" line-height:25px;">
                    <input type="text"   name="Timer"  value="<%=UAgentMacStockObj.Timer %>"/>
                </td>
            </tr>
             <tr>
                <td  style=" line-height:25px;">防冻液：</td>
                <td   style=" line-height:25px;">
                   
                     <select name="Antifreeze">
                        <option value="" <%=UAgentMacStockObj.Antifreeze==""?"selected":"" %>> </option>
                        <option value="-15℃" <%=UAgentMacStockObj.Antifreeze=="-15℃"?"selected":"" %>>-15℃</option>
                         <option value="-25℃" <%=UAgentMacStockObj.Antifreeze=="-25℃"?"selected":"" %>>-25℃</option>
                        <option value="-35℃" <%=UAgentMacStockObj.Antifreeze=="-35℃"?"selected":"" %>>-35℃</option>
                    </select>
                </td>                
                <td  style=" line-height:25px;">柴油：</td>
                <td  style=" line-height:25px; width:80px">
                    <select name="Diesel">
                        <option value="0＃" <%=UAgentMacStockObj.Diesel=="0＃"?"selected":"" %>>0＃</option>
                        <option value="-10＃" <%=UAgentMacStockObj.Diesel=="-10＃"?"selected":"" %>>-10＃</option>
                         <option value="-20＃" <%=UAgentMacStockObj.Diesel=="-20＃"?"selected":"" %>>-20＃</option>
                        <option value="-35＃" <%=UAgentMacStockObj.Diesel=="-35＃"?"selected":"" %>>-35＃</option>
                    </select>
                   
                </td>
                 <td  style=" line-height:25px;">验收地点：</td>
                <td  style=" line-height:25px;">
                      <input type="text"  name="AccepPlace"  value="<%=UAgentMacStockObj.AccepPlace %>"/>
                </td>
            </tr>
            <tr>
                <td>
                    检查表扫描件上传：
                </td>
                <td>
                    <input type="hidden" name="ScanImg" id="UAgentMacNewNGAddScanImg" value="<%=UAgentMacStockObj.ScanImg %>">
                    <input type='file' name='filedata' id='imgUAgentMacNewNGAddScanImg' upload='upload' clientId='UAgentMacNewNGAddScanShow,UAgentMacNewNGAddScanImg' dirtype='6' foldername='<%=User.Department %>' onUploadSuccess='onAgentQltyUploadImgSuccess' fileTypeDesc='只能上传图片' fileTypeExts='*.jpg;*.gif;*.jpeg;*.png;*.bmp' fileSizeLimit='1MB'/>
                    
                </td>
                <td >
                    <a href="<%=UAgentMacStockObj.ScanImg %>" class="imgUAgentMacNewNGAddimgShow"><img id="UAgentMacNewNGAddScanShow" src="<%=UAgentMacStockObj.ScanImg %>" width="30" height="30"></a>
                </td>
                <td colspan="2">
                    <a href="#" onclick="onUAgentMacNewNGAddDeleteImg('UAgentMacNewNGAddScanImg','UAgentMacNewNGAddScanShow')">删除</a>
                </td>
            </tr>
           
            <tr>
                <td colspan="6">
                    <div style="color:red; font-weight:bold; line-height:25px;">注意：只需对检查为错误的项进行打勾,并填写相应的异常记录等</div>
                    <table class="XZJobTrainDetailtable"  style="width:100%; ">
                        <tr>
                            <th width="5%">选择</th>                           
                            <th width="40%">点检项目</th>
                            <th width="15%">异常记录</th>
                            <th width="15%">解决办法</th>
                            <th width="25%" colspan="3" >异常图片</th>
                            
                        </tr>
                        <asp:repeater id="rpMenu" runat="server">
                        <ItemTemplate>
                              <tr>
                                <td  colspan="7" style="font-weight:bold; background-color:#ccc;">
                                   <%# Eval("Title")%>
                                </td>                                
                              </tr>
                             <%# GetSubTrainHtml(Eval("TempID"))%>
                            
                        </ItemTemplate>                       
                        </asp:repeater>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    <div class="formBar">
			<ul>	
                		
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<%--<div class="button"><div class="buttonContent"><button type="button" class="">导出</button></div></div>--%>
				</li>
			</ul>
		</div>    
    </form>
</div>
<script>
    $(document).ready(function () {
        $(":checkbox[name='checkselected']").change(function () {
            checkpagecheckboxXZJobTrainDetail();
        })

        checkpagecheckboxXZJobTrainDetail();

        $("a.imgUAgentMacNewNGAddimgShow").fancybox();
        setTimeout(function(){
            $(":file[upload]").each(function () {
                uploadifyFun($(this));
            });
        },500)
    })

    function checkpagecheckboxXZJobTrainDetail() {

        $(":checkbox[name='checkselected']").each(function () {
            if ($(this).is(':checked')) {
                $(this).closest("tr").find(":text").removeAttr("disabled");
                $(this).closest("tr").find("select ").removeAttr("disabled");
                $(this).closest("tr").find("td").css("color", "red");
            }
            else {
                $(this).closest("tr").find(":text").attr("disabled", "disabled");
                $(this).closest("tr").find("select ").attr("disabled", "disabled");
                $(this).closest("tr").find("td").css("color", "#000");
            }
        })
    }

    function onAgentQltyUploadImgSuccess(file, data, response) {
        if (!response)
            return false;
        data = eval("(" + data + ")");
        if (!data.uploadResult) {
            alert(data.errMsg);
            return;
        }
        var $imgUploadPath = data.filePath;
        var $trageIds = data.customerInfo.split(",");
        $("#" + $trageIds[0]).attr("src", $imgUploadPath);
        $("#" + $trageIds[1]).val($imgUploadPath);

        $("#" + $trageIds[0]).closest("a").attr("href", $imgUploadPath).fancybox();
    }
    function onUAgentMacNewNGAddDeleteImg(hiddenid,imgid)
    {
        $("#" + imgid).attr("src", "");
        $("#" + hiddenid).val("");
    }
</script>
